package com.lz.controller.ly;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.lz.entity.Customer;
import com.lz.service.ly.CustomerService;

@Controller
public class CustomerController {

	@Autowired
	private CustomerService customerService;
	@RequestMapping("/customerGetAll")
	public String getlist(Model model) {
		List<Customer> list = customerService.getAll();
		model.addAttribute("list", list);
		return "aaa";
	}
	
	@RequestMapping("/getCustomertById")
	public String getCustomertById(Model model) {
		Customer customerById = customerService.getCustomerById(1);
		model.addAttribute("customerById", customerById);
		System.out.println(customerById.getCredit().getApplyTimes());
		return "aaa";
	}
}
